home *** CD-ROM | disk | FTP | other *** search
/ Merciful 2 / Merciful - Disc 2.iso / software / s / supremov3.00a1.dms / supremov3.00a1.adf / S / Print_DB.sm < prev    next >
Text File  |  1992-04-01  |  2KB  |  44 lines

  1. /*******************************************************************************
  2.  *
  3.  *   Print_DB.sm                   Copyright (c) 9.01.1995, K. Wojcieszek
  4.  *
  5.  *   Program uruchomiony pod SuperMemo v2.03 (lub nowszym) wypisuje
  6.  *   tekst pytania i odpowiedzi do edytora AmiTekst PRO (AmiTekst_port),
  7.  *   lub innego wyposaûonego w port Arexx-a.
  8.  *
  9.  *   Wersja 1.00
  10.  *
  11.  *******************************************************************************/
  12.  
  13. OPTIONS RESULTS
  14. ADDRESS 'rexx_sm'
  15.  
  16. CR = '0A'X                            /* CR - znak koïca linii */
  17.  
  18. sm_to_edit                            /* Przejdú w tryb przeglâdania */
  19. sm_set 1                            /* Ustaw sië na jednostce nr 1 */
  20. sm_num;  n = RESULT                    /* Sprawdú ile jest wszystkich jedn. */
  21.  
  22. DO l = 1 TO n
  23.     sm_get_q;  question = RESULT    /* Weú tekst kolejnego pytania */    
  24.     sm_get_a;  answer = RESULT        /* Weú tekst kolejnej odpowiedzi */    
  25.     sm_get_rep;  rep = RESULT        /* Weú informacje o powtórkach */    
  26.     question = 'Q: ' || question    /* Formatowanie pytania */
  27.     i = index(question, CR)
  28.     DO while i > 0
  29.         question = insert('Q: ', question, i)
  30.         i = index(question, CR, i+1)
  31.     END
  32.     answer = 'A: ' || answer        /* Formatowanie odpowiedzi */
  33.     i = index(answer, CR)
  34.     DO while i > 0
  35.         answer = insert('A: ', answer, i)
  36.         i = index(answer, CR, i+1)
  37.     END
  38.     item = question || CR || answer || CR || rep || CR || CR
  39.     ADDRESS "AmiTekst_port" Text item    /* Wstaw tekst jednostki edytora */
  40.     sm_next                    /* Przejdú na nastëpnâ jednostkë */
  41.     if RESULT = 'RESULT' then LEAVE
  42. END
  43. sm_to_end                            /* Zamknij okno przeglâdania */
  44.